package cn.lzb.book.server.dao.repository;

import cn.lzb.book.server.dao.mapper.CategoryMapper;
import cn.lzb.book.server.dao.po.CategoryPo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuzhibo
 * @date 2024/8/28 17:00
 **/
@Repository
public class CategoryRepository extends ServiceImpl<CategoryMapper, CategoryPo> implements IService<CategoryPo> {

    public List<CategoryPo> queryCategory(String categoryCode) {
        QueryWrapper<CategoryPo> queryWrapper = new QueryWrapper<CategoryPo>()
                .likeRight("code", categoryCode);
        return list(queryWrapper);
    }

    public List<CategoryPo> queryAllCategory() {
        return list();
    }
}
